var canvas = document.getElementById("pad");
var signaturePad = new SignaturePad(canvas, {
    backgroundColor: 'rgb(255,255,255)',
    onBegin: function () {
        console.log('onbegin')
    },
    onEnd: function () {
        console.log('onEnd')
    }
});
document.getElementById("btnRest").addEventListener('tap', function () {
    signaturePad.clear();
})
document.getElementById("btnSubmit").addEventListener('tap', function () {
    var data_uri = signaturePad.toDataURL();
    var base64Data = data_uri.replace(/^data:image\/\w+;base64,/, "");
    alert(base64Data)
})

function resizeCanvas() {
    canvas.width = window.innerWidth
    canvas.height = window.innerHeight
}
window.addEventListener("resize", resizeCanvas);
resizeCanvas();

